Skip to content

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Sep 19, 2018

  • Handle IntegrityError when fetching credentials
  • Switch to machine-readable log events
  • Mimic correct endpoint with request path
  • Correct invalid test (passing project vs project_id to EventManager.save)

environment='totally unique super duper environment',
))
event = manager.save(project)
event = manager.save(project.id)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noidea.jpg, but it was failing for me

Copy link
Member

@untitaker untitaker Sep 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the call to Project.objects.get_from_cache used to be a cache hit and now it isn't anymore. In case of a cache miss it can't deal with passing a Model, in case of a cache hit it can.

We could just remove the logic that converts Model instances to their PKs in the model manager's get_from_cache since nobody can rely on it anyway. Opinions?

@dcramer dcramer requested a review from untitaker September 19, 2018 23:50
@dcramer
Copy link
Member Author

dcramer commented Sep 19, 2018

The goal of this PR is to stop all of the other tickets where, for example, the migration fails to create sentry_project (correctly), and people keep opening github issues pointing to a wrong root cause.

if key is None:
return

if not is_current_event_safe():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interestingly we call this in both capture() and send(), and I'm not really sure if we need both (but I also dont have the time or care to investigate if we can remove one)


key = None
try:
if settings.SENTRY_PROJECT_KEY is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use this setting in production? I couldn't find it in the repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t think so. I forget why it’s a thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to have shown up in #6785 if we aren't using it do we need to keep it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only real concern would be is if anyone uses it in OS (assuming it still has valid use).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to leave it alone then.

@dcramer
Copy link
Member Author

dcramer commented Sep 20, 2018

Test failures here are super cryptic

@dcramer dcramer force-pushed the feat/improve-internal-client-reporting branch 2 times, most recently from a19116a to 5dadb70 Compare September 21, 2018 19:16
- Handle IntegrityError when fetching credentials
- Switch to machine-readable log events
- Mimic correct endpoint with request path
- Correct invalid test (passing project vs project_id to EventManager.save)
@dcramer dcramer force-pushed the feat/improve-internal-client-reporting branch from 5dadb70 to 31e1f88 Compare September 21, 2018 19:43
@dcramer
Copy link
Member Author

dcramer commented Sep 21, 2018

That was painful to debug. Importing 'sentry.utils.cache' in this module caused the cache to semi-configure in a broken way. It created a lot of cryptic errors (mostly event processing was broken, due to the event never getting stored into the cache). Swapped it out with Django's cached_property instead.

@dcramer dcramer merged commit c347ead into master Sep 21, 2018
@dcramer dcramer deleted the feat/improve-internal-client-reporting branch September 21, 2018 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants